﻿using BL.Models.Account;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;

namespace BL
{
    public class Context : DbContext
    {
        public Context()
            : base("HitMapsDBContext")
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<Context, BL.Migrations.Configuration>("HitMapsDBContext"));
        }

        public DbSet<MenuItem> Menus { get; set; }

        public DbSet<Location> Locations { get; set; }

        public DbSet<User> Users { get; set; }
        public static void Run(Action<Context> action)
        {
            using (Context context = new Context())
            {
                action(context);
            }
        }


    }
}
